package com.situ.day05;

import org.junit.Test;

//实体类
public class Student {
	//属性
	private int id;       //全局变量
	private String name;
	private int age;
	private String className;
	
	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	//无参构造方法
	public Student() {
		
	}

	//有参构造方法
	public Student(int id, String name, int age, String className) {
		this.id = id;
		this.name = name;
		this.age = age;
		this.className = className;
	}

	@Override
	public String toString() {
		return "Student [id=" + id + ", name=" + name + ", age=" + age + ", className=" + className + "]";
	}
	
	
	
	//方法(功能)
	public void study() {
		System.out.println(name+"正在"+className+"班学习");
	}
	public static void main(String[] args) {
		Student student = new Student(1, "suhdgj", 12, "ksahjk");
		System.out.println(student);
	}
	
}
